﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class CalendarManage_MyMessage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserName"] == null)
        {
            Response.Write("<script>alert('请先登录!');window.location.href='../Login.aspx'</script>");

        }
        else
        {
            Bind();
        }
    }
    public void Bind()
    {
        string UserName = Session["UserName"].ToString();
        Sqlselete sl = new Sqlselete();
        int id=sl.SelectTeacherID(UserName);
        DataSet ds=sl.SelectAddressList(id);
        if(ds.Tables[0].Rows.Count == 0)
        {
                    
        }
        else
        {
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();
            this.Label1.Text = "共有"+ds.Tables[0].Rows.Count.ToString()+"位联系人" ;
        }

    }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {

    }
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {

    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {

    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {

    }
    protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {

    }
    protected void cmdAdd_Click(object sender, EventArgs e)
    {

    }
}
